package rfid.service;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.codec.bytes.ByteArrayEncoder;
import io.netty.handler.codec.string.StringEncoder;
import io.netty.handler.stream.ChunkedWriteHandler;

public class SG_RFID_WriteClientInitializer extends ChannelInitializer<SocketChannel> {
    @Override
    protected void initChannel(SocketChannel socketChannel) {
 
        socketChannel.pipeline().addLast("decoder",new StringEncoder());
        socketChannel.pipeline().addLast("encoder", new StringEncoder());
        //客户端处理器
        socketChannel.pipeline().addLast(new SG_RFID_WriteClientHandler());
        socketChannel.pipeline().addLast(new ByteArrayEncoder());
        socketChannel.pipeline().addLast(new ChunkedWriteHandler());

    }
}
